package com.yangtao.springbootfreemarker.web.controller.common;

import com.yangtao.core.jpa.BasePage;
import com.yangtao.core.shiro.service.impl.ShiroSecurityService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContext;

/**
 * 通用controller
 */
public class ControllerBase extends BasePage {

	@Autowired
	protected ShiroSecurityService shiroSecurityService;

	/**
	 * 获取当前组织号
	 * @return
	 */
	protected String getOrgId() {
		return shiroSecurityService.getOrgId();
	};

	/**
	 * 获取当前用户id
	 * @return
	 */
	protected String getUserId() {
		return shiroSecurityService.getUserId();
	}

	public ServletContext getServletContext() {
		return servletContext;
	}

	public void setServletContext(ServletContext servletContext) {
		this.servletContext = servletContext;
	}
}
